package com.showsu.editor.utils.aliyun.moderaction;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author edison
 */

@Getter
@AllArgsConstructor
public enum AliyunTextModerationServiceCodeEnum {

    ai_art_detection("ai_art_detection", "AIGC类文字检测"),
    comment_detection("comment_detection", "公聊评论内容检测"),
    nickname_detection("nickname_detection", "用户昵称检测"),
    chat_detection("chat_detection", "私聊互动内容检测"),
    ad_compliance_detection("ad_compliance_detection", "广告法合规检测"),
    comment_multilingual_pro("comment_multilingual_pro", "国际业务多语言检测"),
    pgc_detection("pgc_detection", "PGC通用物料检测"),
    url_detection("url_detection", "URL风险链接检测"),
    ;

    /**
     * 错误码
     */
    final String code;

    /**
     * 错误描述
     */
    final String msg;

    public static AliyunTextModerationServiceCodeEnum getByCode(String code) {
        for(AliyunTextModerationServiceCodeEnum serviceCodeEnum : AliyunTextModerationServiceCodeEnum.values()) {
            if (serviceCodeEnum.getCode().equals(code)){
                return serviceCodeEnum;
            }
        }
        return AliyunTextModerationServiceCodeEnum.comment_detection;
    }
}
